package com.Day1008;

import sun.plugin2.os.windows.SECURITY_ATTRIBUTES;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class MainText {
    public static void main(String[] args) {
        Set set = new HashSet();
        String s1 = new String("java");
        String s2 = s1;
        set.add(s1);
        System.out.println("set集合大小：" + set.size());
        set.add(s2);
        System.out.println("set集合大小：" + set.size());
        String s3 = new String("Java");
        set.add(s3);
        System.out.println("set集合大小：" + set.size());
        String s4 = new String("Python");
        set.add(s4);
        System.out.println("set集合大小：" + set.size());
        //   set 集合用迭代器取值
//        Iterator iterator =  set.iterator();
//        while (iterator.hasNext()){
//            System.out.println(iterator.next());
//        }
        for (Object st : set) {
            System.out.println(st);
        }
    }
}
